<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>05_条件渲染</title>
</head>
<body>
<!--
1. 条件渲染指令
  v-if
  v-else
  v-show
2. 比较v-if与v-show
  如果需要频繁切换 v-show 较好
-->
<div id="demo">
	<P v-if="ok">success</P>
	<P v-else>failed</P>
	
	<p v-show="ok">表白成功</p>
	<p v-show="!ok">表白失败</p>
    <button @click="ok=!ok">change</button>
</div>
<script src="../js/vue.js"></script>
<script>
	const vm = new Vue({
		el: '#demo',
		data: {
           ok: true,
		}
	})
</script>
</body>

</html>